<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <!-- 
        v-pre指令：
            1.跳过其所在的节点的编译过程
            2.可利用它跳过没有指令语法、没有使用插值语法的节点，加快Vue编译
     -->
    <div id="root">
        <h2 v-pre>Vue其实很简单</h2>
        <h2 v-once>初始n为:{{n}}</h2>
        <h2>current:{{n}}</h2>
        <button @click="n++">点我n+1</button>
    </div>

    <script>
        Vue.config.productionTip = false;
        new Vue({
            el: "#root",
            data() {
                return {
                    n: 1
                }
            },
        })
    </script>

</body>

</html>